import request from '@/config/axios'


/** 学校信息信息 */
export interface School {
          id: number; // 学校ID
          schoolName?: string; // 学校名称
          schoolCode: string; // 学校编码
          address: string; // 学校地址
          contactPhone: string; // 联系电话
          status?: number; // 状态（0正常 1停用）
  }

// 学校信息 API
export const SchoolApi = {
  // 查询学校信息分页
  getSchoolPage: async (params: any) => {
    return await request.get({ url: `/ao/school/page`, params })
  },

  // 查询学校信息详情
  getSchool: async (id: number) => {
    return await request.get({ url: `/ao/school/get?id=` + id })
  },

  // 新增学校信息
  createSchool: async (data: School) => {
    return await request.post({ url: `/ao/school/create`, data })
  },

  // 修改学校信息
  updateSchool: async (data: School) => {
    return await request.put({ url: `/ao/school/update`, data })
  },

  // 删除学校信息
  deleteSchool: async (id: number) => {
    return await request.delete({ url: `/ao/school/delete?id=` + id })
  },

  /** 批量删除学校信息 */
  deleteSchoolList: async (ids: number[]) => {
    return await request.delete({ url: `/ao/school/delete-list?ids=${ids.join(',')}` })
  },

  // 导出学校信息 Excel
  exportSchool: async (params) => {
    return await request.download({ url: `/ao/school/export-excel`, params })
  }
}
